//
//  Inject.m
//  RunLoopDemo
//
//  Created by zhangjikuan on 2020/11/11.
//  Copyright © 2020 hsgd. All rights reserved.
//

#import "Inject.h"
#import <objc/runtime.h>
#import <UIKit/UIKit.h>

@implementation Inject

+ (void)load {
    // method swizzing
    // 在面向切面编程上很有作用
    Method method = class_getInstanceMethod(objc_getClass("AQIphoneManager"), @selector(onNext));
    onNext = method_getImplementation(method);
    method_setImplementation(method, my_onNext);
    
    /// hook 所有相关的方法，做一些自己的操作
}

IMP (*onNext)(id self ,SEL __cmd);

void my_onNext(id self,SEL __cmd) {
    NSLog(@"密码是多少呢？？");
    onNext(self, __cmd);
}


@end
